﻿@using PortalCurriculo.MvcWebUI.Resources.Curriculo
@using PortalCurriculo.MvcWebUI.Resources.Geral
@model IEnumerable<PortalCurriculo.MvcWebUI.Models.CurriculoModel>
@if (Model == null || !Model.Any())
{
    <div>
        @Mensagens.NaoHaDados
    </div>
    return;
}
@foreach (var item in Model)
{
    <div id="@string.Concat("divEditCurriculo", item.Id)" class="listaBotao">
        <div class="buttons" id="@string.Concat("divButtonsCurriculo", item.Id)">
            @Ajax.ActionLink(Botoes.Excluir, "Excluir", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "listaCurriculos", HttpMethod = "Get", Confirm = "Tem certeza que deseja excluir?" },
                       new { @class = "deleteButton" })
            @Ajax.ActionLink(Botoes.Editar, "Manter", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "editFormCurriculo", HttpMethod = "Get", OnBegin = "openDialog" },
                       new { @class = "editButton" })
            @Ajax.ActionLink(Geral.EditarCargos, "MasterEdicao", "CargoCurriculo", new { idCurriculo = item.Id },
          new AjaxOptions { UpdateTargetId = "masterEdicaoCargos", HttpMethod = "Get", OnBegin = "openDialogCargos" },
          new { @class = "button editCargos" })
        </div>
        <div style="width: 50%" class="floatLeft">
            <strong>@Html.LabelFor(modelItem => item.Objetivo): </strong>@Html.DisplayFor(modelItem => item.Objetivo)
        </div>
        <div style="width: 45%" class="floatLeft">
            <strong>@Html.LabelFor(modelItem => item.DataUltimaAtualizacao): </strong>@Html.DisplayFor(modelItem => item.DataUltimaAtualizacao)
        </div>
        <div style="width: 100%">
            <strong>@Html.LabelFor(modelItem => item.IdNivelProfissional): </strong>@Html.DisplayFor(modelItem => item.NivelProfissional.Descricao)
        </div>
        <div class="clear">
            <strong>@Html.LabelFor(modelItem => item.CartaApresentacao):</strong> <br/>
            @Html.DisplayFor(modelItem => item.CartaApresentacao)
        </div>
        
        @if (PortalCurriculo.MvcWebUI.Helpers.LoggedHelper.IsSameProfessional(item.IdProfissional))
                {
            <script type="text/javascript">
                        $("#divIncluirCurriculo").show();
                        $("#@string.Concat("divEditCurriculo", item.Id)").editDiv({ 
                            divButtonsId: "@string.Concat("divButtonsCurriculo", item.Id)"
                        });
            </script>
                }
    </div>
}
    